<template>
  <div class="search-buttons">
    <div class="search __hover" @click="$emit('handleSearch')">查 询</div>
    <div class="reset __hover" @click="$emit('handleReset')">重 置</div>
    <div
      class="expand __hover"
      v-if="expandValue !== null"
      @click="$emit('update:expandValue', !expandValue)"
    >
      {{ expandValue ? '收起' : '展开' }}
      <SvgIcon name="czr_arrow" size="14" :rotate="expandValue ? 270 : 90" />
    </div>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: 'CzrSearchButtons',
})
const props = defineProps({
  expandValue: {
    default: null,
  },
})
</script>

<style scoped lang="scss">
.search-buttons {
  margin-left: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin-bottom: 12px;
  > div {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    box-sizing: border-box;
    &:last-child {
      margin-right: 0;
    }
  }
  .search {
    width: 60px;
    height: 32px;
    background: var(--czr-main-color);
    border-radius: 2px;
    color: #ffffff;
  }
  .reset {
    width: 60px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 2px;
    color: #576275;
    background-color: #f6f8fc;
  }
  .expand {
    line-height: 32px;
    color: var(--czr-main-color);
    .svg-icon {
      margin-left: 9px;
    }
  }
}
</style>
